package com.ordertracker.persistent.dictionary.template;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * Description of class.
 * Created 2/4/13 12:06 PM
 *
 * @author andrey.rodin@playtech.com
 */

@MappedSuperclass
public class AbstractPositionTemplate extends StateEntityTemplate {

    @Column(nullable = false)
    private String name;

    protected AbstractPositionTemplate() {
    }

    protected AbstractPositionTemplate(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AbstractPositionTemplate)) return false;

        AbstractPositionTemplate that = (AbstractPositionTemplate) o;

        if (!name.equals(that.name)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public String toString() {
        return "AbstractPositionTemplate{" +
                "name='" + name + '\'' +
                "} " + super.toString();
    }


}
